﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Manage_Comment.aspx.cs" Inherits="Manage_Comment" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Src="~/head.ascx" TagName="head" TagPrefix="uc1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>留言板——留言管理</title>
</head>
<body>
    <form id="form1" runat="server">
    <uc1:head ID="head2" runat="server" />
    <br />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
        AutoGenerateColumns="False" AutoGenerateDeleteButton="True" CellPadding="4" DataKeyNames="CommentId"
        DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" HorizontalAlign="center"
        OnSelectedIndexChanged="GridView1_SelectedIndexChanged" Width="100%">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:BoundField DataField="CommentId" HeaderText="留言ID" ReadOnly="True" SortExpression="CommentId"
                ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
            <asp:BoundField DataField="UserId" HeaderText="用户ID" SortExpression="UserId" ItemStyle-Width="10%"
                HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
            <asp:BoundField DataField="Comment_content" HeaderText="留言内容" SortExpression="Comment_content"
                ItemStyle-Width="70%" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
            <asp:BoundField DataField="Comment_data" HeaderText="发表留言时间" SortExpression="Comment_data"
                ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
        </Columns>
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT * FROM [Comment]" DeleteCommand="DELETE FROM Comment WHERE CommentId = @CommentId">
        <DeleteParameters>
            <asp:Parameter Name="CommentId" Type="Int32" />
        </DeleteParameters>
    </asp:SqlDataSource>
    </form>
</body>
</html>
